<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Hello World</title>
  <script src="https://unpkg.com/vue"></script>
</head>

<body>
  <div id="root"></div>
  <script>
    /* 
      操作：
      - 控制台中修改vm.price = 6
    */
    const app = Vue.createApp({
      template: `<div>
        <h3>{{msg}}</h3>
      </div>`,
      data() {
        return {
          msg: `Hello World`,
          count: 1,
          price: 5
        }
      },
      watch: {
        price(current, prev) {
          console.log('价格改变了', current, prev);
        }
      }
    })
    const vm = app.mount('#root');
  </script>
</body>

</html>